//
//  UIButton+Extension.swift
//  weibo
//
//  Created by songhuipan on 16/4/18.
//  Copyright © 2016年 songhuipan. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(imageName:String,backIamgeName:String) {
        
        self.init()
        
        setImage(UIImage(named: imageName+"_highlighted"), forState: UIControlState.Highlighted)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        
        setBackgroundImage(UIImage(named: backIamgeName), forState: UIControlState.Normal)
        
        setBackgroundImage(UIImage(named: backIamgeName+"_highlighted"), forState: UIControlState.Highlighted)
        
        sizeToFit()
    }
}
